#ifndef RECORDTASKMANAGER_H
#define RECORDTASKMANAGER_H

#include <QList>
#include <QObject>

class LiveRecorder;
class RecordTask;

class RecordTaskManager : public QObject
{
    Q_OBJECT
public:
    explicit RecordTaskManager(LiveRecorder* recorder);
    ~RecordTaskManager();

    int count() const { return tasks_.size(); }
    bool isRunning(int attention) const;
    void start(int attention);
    void stop(int attention);
    void stopAll();
    void termiate(int attention);
    void termiateAll();

Q_SIGNALS:
    void aboutToStart(int attention);
    void positionChanged(int attention, qint64 duration);
    void finished(int attention, const QString& filename, qint64 duration);
    void failed(int attention, int error, const QString& message);

private:
    LiveRecorder* recorder_;
    QList<RecordTask*> tasks_;
};

#endif // RECORDTASKMANAGER_H
